home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / disk utilities / dirutil / dopus / opus5utils / arexx / dirtodest.dopus5 < prev    next >
Encoding:
Text File  |  1997-11-21  |  2.2 KB  |  75 lines

  1. /* DirToDest for Directory Opus 5.
  2.    By Leo Davidson ("Nudel", Pot-Noodle/Gods'Gift Utilities)
  3.  
  4. $VER: DirToDest.dopus5 1.3 (18.8.95)
  5.  
  6.    NOTE: This script _requires_ DOpus v5.11 or above.
  7.  
  8.    The scrips changes the DEST lister's path to the first selected directory
  9.    in the SOURCE lister. It's for when I don't want to reach for the SHIFT
  10.    key to drag-n-drop a directory into another lister.
  11.  
  12.    v1.00 -> v1.01 - Now deselects the directory. (Oops, forgot about that).
  13.    v1.01 -> v1.02 - V. small changes, nothing to think about.
  14.                     Now checks to make sure the DOPUS.x port exists.
  15.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  16.                     Style Guide compliant version numbering and $VER string.
  17.  
  18. Call as:
  19. ------------------------------------------------------------------------------
  20. ARexx    DOpus5:ARexx/DirToDest.dopus5 {Qp}
  21. ------------------------------------------------------------------------------
  22. Turn off all switches.
  23. */
  24.  
  25. options results
  26. options failat 99
  27. signal on syntax;signal on ioerr        /* Error trapping */
  28. parse arg DOpusPort
  29. DOpusPort = Strip(DOpusPort,"B",'" ')
  30.  
  31. If DOpusPort="" THEN Do
  32.     Say "Not correctly called from Directory Opus 5!"
  33.     Say "Load this ARexx script into an editor for more info."
  34.     EXIT
  35.     END
  36. If ~Show("P",DOpusPort) Then Do
  37.     Say DOpusPort "is not a valid port."
  38.     EXIT
  39.     End
  40. Address value DOpusPort
  41.  
  42.  
  43. lister query source stem source_handle.
  44.  
  45. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  46.     dopus request '"You must have a SOURCE lister!" OK'
  47.     EXIT
  48.     End
  49.  
  50.  
  51. lister query dest stem dest_handle.
  52.  
  53. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  54.     dopus request '"You must have a DESTINATION lister!" OK'
  55.     EXIT
  56.     End
  57.  
  58.  
  59. lister query source_handle.0 path
  60. source_path = RESULT
  61. lister query source_handle.0 seldirs stem source_dir.
  62.  
  63. IF source_dir.count = 0 | source_dir.count = "SOURCE_DIR.COUNT" Then Do
  64.     dopus request '"You must have a directory selected'||X2C(0A)||'in the SOURCE lister!" OK'
  65.     EXIT
  66.     End
  67.  
  68. lister read dest_handle.0 source_path||source_dir.0
  69.  
  70. lister select source_handle.0 source_dir.0 0
  71. lister refresh source_handle.0
  72.  
  73. syntax:;ioerr:                /* In case of error, jump here */
  74. EXIT
  75.